Skip to content

Conversation

Badel2
Copy link
Contributor

@Badel2 Badel2 commented Feb 11, 2022

I got an error when trying to build the compiler using an old commit, and it turns out it was because the option download-ci-llvm was implicitly set to true. So this pull request tries to add a help message for other people that may run into the same problem.

To reproduce my error:

git checkout 8d7707f3c4f72e6eb334d897354beca692b265d1
./x.py test
[...]
spurious failure, trying again
downloading https://ci-artifacts.rust-lang.org/rustc-builds/db002a06ae9154a35d410550bc5132df883d7baa/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
curl: (22) The requested URL returned error: 404 

failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp8g13rb4n https://ci-artifacts.rust-lang.org/rustc-builds/db002a06ae9154a35d410550bc5132df883d7baa/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
Build completed unsuccessfully in 0:00:46

This is my config.toml:

# Includes one of the default files in src/bootstrap/defaults
profile = "compiler"
changelog-seen = 2

[rust]
debug = true

To reproduce an error with this branch:

Change line 618 of bootstrap.py to

        url = "rustc-builds-error404/{}".format(llvm_sha)

Delete llvm and cached tarball, and set llvm.download-ci-llvm=true in config.toml.

./x.py test
[...]
spurious failure, trying again
downloading https://ci-artifacts.rust-lang.org/rustc-builds-error404/719b04ca99be0c78e09a8ec5e2eda082a5d8ccae/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
curl: (22) The requested URL returned error: 404 

failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmpesl1ydvo https://ci-artifacts.rust-lang.org/rustc-builds-error404/719b04ca99be0c78e09a8ec5e2eda082a5d8ccae/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
error: failed to download llvm from ci
help: old builds get deleted after a certain time
help: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:

[llvm]
download-ci-llvm = false

Build completed unsuccessfully in 0:00:01

Regarding the implementation, I expected to be able to use a try/catch block in _download_ci_llvm, but the run function calls sys.exit instead of raising an exception so that's not possible. Also, suggestions for better wording of the help message are welcome.

@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 11, 2022
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

This seems pretty positive to me.